home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / misc / gs261src.zip / gsstate.h < prev    next >
C/C++ Source or Header  |  1993-05-13  |  5KB  |  123 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* gsstate.h */
  20. /* Graphics state routines for Ghostscript library */
  21.  
  22. /* Opaque type for a graphics state */
  23. /*typedef struct gs_state_s gs_state;*/    /* defined in gs.h */
  24.  
  25. /* Line cap values */
  26. typedef enum {
  27.     gs_cap_butt = 0,
  28.     gs_cap_round = 1,
  29.     gs_cap_square = 2
  30. } gs_line_cap;
  31.  
  32. /* Line join values */
  33. typedef enum {
  34.     gs_join_miter = 0,
  35.     gs_join_round = 1,
  36.     gs_join_bevel = 2
  37. } gs_line_join;
  38.  
  39. /* Allocation, freeing, initialization, and copying */
  40. gs_state *gs_state_alloc(P1(const gs_memory_procs *)); /* 0 if fails */
  41. int    gs_state_free(P1(gs_state *));
  42. int    gs_gsave(P1(gs_state *)),
  43.     gs_grestore(P1(gs_state *)),
  44.     gs_grestoreall(P1(gs_state *));
  45. gs_state *gs_gstate(P1(gs_state *));
  46. int    gs_copygstate(P2(gs_state * /*to*/, const gs_state * /*from*/)),
  47.     gs_currentgstate(P2(gs_state * /*to*/, const gs_state * /*from*/)),
  48.     gs_setgstate(P2(gs_state * /*to*/, const gs_state * /*from*/));
  49. gs_state *gs_state_swap_saved(P2(gs_state *, gs_state *));    /* special for save/restore */
  50. int    gs_initgraphics(P1(gs_state *));
  51.  
  52. /* Device control */
  53. #ifndef gx_device_DEFINED
  54. #  define gx_device_DEFINED
  55. typedef struct gx_device_s gx_device;
  56. #endif
  57. #ifndef gs_prop_item_DEFINED
  58. #  define gs_prop_item_DEFINED
  59. typedef struct gs_prop_item_s gs_prop_item;
  60. extern const uint gs_prop_item_sizeof;
  61. #endif
  62. int    gs_flushpage(P1(gs_state *));
  63. int    gs_copypage(P1(gs_state *));
  64. int    gs_output_page(P3(gs_state *, int, int));
  65. int    gs_copyscanlines(P6(gx_device *, int, byte *, uint, int *, uint *));
  66. gx_device *    gs_getdevice(P1(int));
  67. int    gs_copydevice(P3(gx_device **, const gx_device *, const gs_memory_procs *));
  68. int    gs_makeimagedevice(P7(gx_device **, const gs_matrix *, uint, uint, const byte *, int, const gs_memory_procs *));
  69. void    gs_nulldevice(P1(gs_state *));
  70. int    gs_setdevice(P2(gs_state *, gx_device *));
  71. gx_device *    gs_currentdevice(P1(const gs_state *));
  72. const char *    gs_devicename(P1(const gx_device *));
  73. void    gs_deviceinitialmatrix(P2(gx_device *, gs_matrix *));
  74. int    gs_getdeviceprops_size(P1(gx_device *));
  75. int    gs_getdeviceprops(P2(gx_device *, gs_prop_item *));
  76. int    gs_putdeviceprops(P3(gx_device *, gs_prop_item *, int));
  77. int    gs_closedevice(P1(gx_device *));
  78.  
  79. /* Line parameters and quality */
  80. int    gs_setlinewidth(P2(gs_state *, floatp));
  81. float    gs_currentlinewidth(P1(const gs_state *));
  82. int    gs_setlinecap(P2(gs_state *, gs_line_cap));
  83. gs_line_cap    gs_currentlinecap(P1(const gs_state *));
  84. int    gs_setlinejoin(P2(gs_state *, gs_line_join));
  85. gs_line_join    gs_currentlinejoin(P1(const gs_state *));
  86. int    gs_setmiterlimit(P2(gs_state *, floatp));
  87. float    gs_currentmiterlimit(P1(const gs_state *));
  88. int    gs_setdash(P4(gs_state *, const float *, uint, floatp));
  89. uint    gs_currentdash_length(P1(const gs_state *));
  90. int    gs_currentdash_pattern(P2(const gs_state *, float *));
  91. float    gs_currentdash_offset(P1(const gs_state *));
  92. int    gs_setflat(P2(gs_state *, floatp));
  93. float    gs_currentflat(P1(const gs_state *));
  94. int    gs_setstrokeadjust(P2(gs_state *, int));
  95. int    gs_currentstrokeadjust(P1(const gs_state *));
  96.  
  97. /* Color and gray */
  98. #include "gscolor.h"
  99.  
  100. /* Halftone screen */
  101. int    gs_setscreen(P4(gs_state *, floatp, floatp, float (*)(P2(floatp, floatp))));
  102. int    gs_currentscreen(P4(gs_state *, float *, float *, float (**)(P2(floatp, floatp))));
  103. int    gs_sethalftonephase(P3(gs_state *, int, int));
  104. int    gs_currenthalftonephase(P2(gs_state *, gs_int_point *));
  105. /* Enumeration-style screen definition */
  106. typedef struct gs_screen_enum_s gs_screen_enum;
  107. extern const uint gs_screen_enum_sizeof;
  108. int    gs_screen_init(P4(gs_screen_enum *, gs_state *, floatp, floatp));
  109. int    gs_screen_currentpoint(P2(gs_screen_enum *, gs_point *));
  110. int    gs_screen_next(P2(gs_screen_enum *, floatp));
  111.  
  112. /* "Client data" interface for graphics states. */
  113. typedef char/*void*/ *(*gs_state_alloc_proc_t)(P1(const gs_memory_procs *mp));
  114. typedef int (*gs_state_copy_proc_t)(P2(char/*void*/ *to, const char/*void*/ *from));
  115. typedef void (*gs_state_free_proc_t)(P2(char/*void*/ *old, const gs_memory_procs *mp));
  116. typedef struct gs_state_client_procs_s {
  117.     gs_state_alloc_proc_t alloc;
  118.     gs_state_copy_proc_t copy;
  119.     gs_state_free_proc_t free;
  120. } gs_state_client_procs;
  121. void    gs_state_set_client(P3(gs_state *, char/*void*/ *, const gs_state_client_procs *));
  122. char/*void*/ *gs_state_client_data(P1(gs_state *));
  123.